<template>
	<view>
		<table>
			<tr>
				<td>用户名</td>
				<td><input type="text" style="background-color: antiquewhite;" v-model="username"></td>
			</tr>
			<tr>
				<td>密码</td>
				<td><input type="text" style="background-color: antiquewhite;" v-model="password"></td>
			</tr>
			<button @click="login()">登录</button>
			<button @click="resister()">注册</button>
		</table>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				username : "",
				password : "",
			}
		},
		methods: {
			resister(){
				
			},
			login(){
				uni.request({
					url: 'http://127.0.0.1:8080/logein', //仅为示例，并非真实接口地址。
					data: {
						username :this.username,
						password :this.password,
					},
					method: "POST",
					header: {
						'content-type': 'application/x-www-form-urlencoded' //自定义请求头信息
					},
					success: (res) => {
						console.log(res.data)
					}
				});
			},
		}
	}
</script>

<style>

</style>
